<!DOCTYPE html>
<html lang="en">
    <script>
        function btn_post_http(){
            var xhr = new XMLHttpRequest();
            xhr.open("POST","http://172.16.182.230:9999/dingtalk/rest/plugin/service/dingtalk/text",true);
            xhr.setRequestHeader("Content-type", "application/json");
            xhr.onreadystatechange = function(){
                if(xhr.readyState == 4){
                    if(xhr.status == 200){
                        alert("OK");
                    }
                }
            };
            xhr.send(JSON.stringify({
                "atAll" : false,
                "content" : "test_JS",
                "messageType" : "text"
            }));
        }
    </script>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn1" type="button" onclick="btn_post_http();">点击发送</button>
</body>
</html>